package com.youlai.boot.system.converter;

import com.youlai.boot.system.converter.worker.TypeConversionWorker;
import com.youlai.boot.system.model.entity.Project;
import com.youlai.boot.system.model.vo.ArchivesVO;
import com.youlai.boot.system.model.vo.ProjectVO;
import org.mapstruct.Mapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.youlai.boot.system.model.entity.Archives;
import com.youlai.boot.system.model.form.ArchivesForm;
import org.mapstruct.Mapping;

/**
 * 博客文章对象转换器
 *
 * @author youlaitech
 * @since 2025-03-15 19:25
 */
@Mapper(componentModel = "spring", uses = TypeConversionWorker.class)
public interface ArchivesConverter{

    @Mapping(target = "tags",source = "tags",qualifiedByName = "toStrList")
    ArchivesForm toForm(Archives entity);

    @Mapping(target = "tags",source = "tags",qualifiedByName = "toJsonString")
    Archives toEntity(ArchivesForm formData);

    @Mapping(target = "tags",source = "tags",qualifiedByName = "toStrList")
    ArchivesVO toArchivesVo(Archives entity);
}